<template>
	<view>
		<uniFooter ref="footer"></uniFooter>
		<button type="default" @click="myClick">父组件</button>
		
		<view v-if="detail!=null">
			<view class="">
				{{detail.goodsname}}
			</view>
			<view v-for="(item,index) in detail.specsattr.split(',')">
				{{item}}
			</view>
		</view>
	</view>
</template>

<script>
	import uniFooter from "../../components/uni-footer/uni-footer.vue"
	export default {
		data() {
			return {
				detail:null
			}
		},
		
		components: {
			uniFooter
		},
		async onLoad(){
			let result =await this.$http({url:"/api/getgoodsinfo",data:{id:1}})
			this.detail=result.data.list[0]
		},
		methods: {
			myClick(){
				console.log(this.$refs.footer.handleClick())
			}
		},
		filters:{
			getArr(value){
				return value.split(",")
			}
		},
	}
</script>

<style>

</style>
